package com.atguigu.educms.service.impl;

import com.atguigu.educms.entity.EduTeacher;
import com.atguigu.educms.mapper.EduTeacherMapper;
import com.atguigu.educms.service.EduTeacherService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author Administrator
* @description 针对表【edu_teacher(讲师)】的数据库操作Service实现
* @createDate 2022-12-21 19:48:49
*/
@Service
public class EduTeacherServiceImpl extends ServiceImpl<EduTeacherMapper, EduTeacher>
implements EduTeacherService {
    @Autowired
    private EduTeacherMapper eduTeacherMapper;
    @Override
    public List<EduTeacher> getTeacher() {
        QueryWrapper<EduTeacher> wrapper = new QueryWrapper<>();
        wrapper.orderByDesc("id");
        wrapper.last("limit 4");
        List<EduTeacher> eduTeachers = eduTeacherMapper.selectList(wrapper);
        return eduTeachers;
    }
}
